plotLineHisto <- function("C:/Users/Melanie/Desktop/RKurs/development/eimar-vpspph-ws2011/jsjper/dataset_humidity.dat") {
  
## read in data
dat <- read.csv(plotLineHisto)

## load necessary packages
library(latticeExtra)

## define plot object
plot <- xyplot(dat$rh_wxt ~ as.POSIXct(dat$dateEAT) | dat$plotID,
             subset = dat$plotID != "", col = "blue",
             type = "l", layout = c(1,2)) 

plot

## define and combine histograms
histomai1 <- histogram(dat$rh_wxt, freq = T, subset = dat$plotID == "mai1", 
                       xlab = "mai1")

histocof3 <- histogram(dat$rh_wxt, freq = T, subset = dat$plotID == "cof3", 
                       xlab = "cof3")

combohisto <- c(histomai1, histocof3, layout = c(2,1))

combohisto

## combine plot and histogram

combo <- c(combohisto, plot, layout = c(2,2))

combo

return(combo)

}
